:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5f6fa;
    --success-color: #2ecc71;
    --warning-color: #f1c40f;
    --danger-color: #e74c3c;
    --text-color: #2c3e50;
    --border-color: #dcdde1;
    --shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    animation: fadeIn 0.5s ease;
}

header {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

h1 {
    color: var(--text-color);
    margin-bottom: 20px;
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
}

nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

button {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

button:hover {
    background-color: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
}

.section {
    background-color: #fff;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    animation: slideUp 0.5s ease;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--secondary-color);
    font-weight: 600;
}

tr {
    transition: var(--transition);
}

tr:hover {
    background-color: rgba(74, 144, 226, 0.05);
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    z-index: 1000;
    animation: modalFadeIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    animation: fadeIn 0.3s ease;
}

.edit-btn {
    background-color: var(--warning-color);
    color: #000;
}

.delete-btn {
    background-color: var(--danger-color);
}

.status-excellent {
    background-color: var(--success-color);
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        padding: 15px;
    }

    h1 {
        font-size: 1.5rem;
    }

    nav {
        flex-direction: column;
        gap: 10px;
    }

    button {
        width: 100%;
        justify-content: center;
    }

    .section {
        padding: 15px;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    th, td {
        padding: 10px;
    }
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
    overflow: hidden;
}

.login-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.2) 0%, transparent 40%),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,0.2) 0%, transparent 40%);
    animation: backgroundFloat 20s ease-in-out infinite;
}

@keyframes backgroundFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-5%, -5%); }
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    position: relative;
    backdrop-filter: blur(10px);
    animation: loginBoxAppear 0.6s ease-out;
}

@keyframes loginBoxAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-icon {
    text-align: center;
    margin-bottom: 20px;
}

.login-icon i {
    font-size: 48px;
    color: var(--primary-color);
    animation: pulseIcon 2s ease-in-out infinite;
}

@keyframes pulseIcon {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.login-box h1 {
    font-size: 24px;
    margin-bottom: 30px;
    color: var(--text-color);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    transition: var(--transition);
}

.login-form input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition);
    background: white;
}

.login-form input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
    outline: none;
}

.login-form input:focus + i {
    color: var(--primary-color);
}

.login-form button {
    background-color: var(--primary-color);
    color: white;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-form button:hover {
    background-color: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
}

.error-message {
    background-color: #fee2e2;
    color: #dc2626;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    color: #666;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .login-box {
        margin: 20px;
        padding: 30px;
    }

    .login-box h1 {
        font-size: 20px;
    }
}

/* 主页面模块卡片样式 */
.dashboard {
    padding: 40px 0;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px;
}

.module-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-color);
    text-align: center;
    transition: var(--transition);
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.module-card i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.module-card h2 {
    margin-bottom: 10px;
    font-size: 24px;
}

.module-card p {
    color: #666;
}

/* 页面头部样式 */
.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
}

.back-btn:hover {
    color: var(--primary-color);
}

/* 老年人选择器样式 */
.elderly-selector {
    margin-bottom: 20px;
}

.elderly-selector select {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
}

/* 健康建议样式 */
.advice-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.advice-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    transition: var(--transition);
}

.advice-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 不同类型建议的样式 */
.advice-item.medical {
    border-left: 4px solid #dc3545;  /* 医疗建议用红色 */
}

.advice-item.lifestyle {
    border-left: 4px solid #28a745;  /* 生活方式建议用绿色 */
    background: linear-gradient(to right, rgba(40, 167, 69, 0.05), transparent);
}

.advice-item.monitoring {
    border-left: 4px solid #007bff;  /* 监测建议用蓝色 */
}

.advice-item h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: var(--text-color);
}

.advice-item h4 i {
    font-size: 1.2em;
}

.advice-item p {
    white-space: pre-line;
    line-height: 1.6;
    padding: 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
}

.advice-summary {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 5px;
    border-left: 4px solid #28a745;
    display: flex;
    align-items: center;
    gap: 10px;
}

.advice-summary h3 {
    display: flex;
    align-items: center;
    gap: 8px;
} 